@extends('layouts.admin')
@section('title')
    <title>会员详情页</title>
@endsection
@section('content')
    @include('layouts.left')
    <!-- Content Wrapper. Contains page content -->
    <div class="content-wrapper">
        <!-- Content Header (Page header) -->
        <section class="content-header">
            <h1>
                Dashboard
                <small>Control panel</small>
            </h1>
            <ol class="breadcrumb">
                <li><a href="#"><i class="fa fa-dashboard"></i> Home</a></li>
                <li class="active">Dashboard</li>
            </ol>
        </section>
        <!-- Main content -->
        <section class="content">
        <div class="row">
                <div class="col-md-12">
                    <div class="box">
                        <div class="box-header">
                            <h3 class="box-title">查看会员详情</h3>
                        </div>
                        <!-- /.box-header -->
                        <div class="box-body no-padding">
                            <table class="table table-striped">
                                <tbody>
                                <tr>
                                    <th style="width: 130px">uid</th>
                                    <td>{{ $datas['uid'] }}</td>
                                </tr>
                                <tr>
                                    <th style="width: 130px">姓名</th>
                                    <td>{{ $datas['username'] }}</td>
                                </tr>
                                <tr>
                                    <th style="width: 130px">电话</th>
                                    <td>{{ $datas['mobile'] }}</td>
                                </tr>
                                <tr>
                                    <th style="width: 130px">昵称</th>
                                    <td >{{ $datas['nickname'] }}</td>
                                </tr>
                                <tr>
                                    <th style="width: 130px">性别</th>
                                    <td class="sex">{{ $datas['sex'] }}</td>
                                </tr>
                                <tr>
                                    <th style="width: 130px">头像</th>
                                    <td><img src="{{asset($datas['avatar'])}}"></td>
                                </tr>
                                <tr>
                                    <th style="width: 130px">地区</th>
                                    <td>{{ $datas['regcity']->country }} {{$datas['regcity']-> province}} {{ $datas['regcity']->city }}</td>
                                </tr>
                                <tr>
                                    <th style="width: 130px">状态</th>
                                    <td class="status">{{ $datas['status'] }}</td>
                                </tr>
                                <tr>
                                    <th style="width: 130px">来源店铺</th>
                                    <td>
                                    @foreach($datas['shop'] as $data)
                                      <span>{{ $data -> shopname}}</span>
                                      <span>&nbsp;&nbsp;&nbsp;</span>
                                    @endforeach
                                    </td>
                                </tr>
                                </tbody>
                            </table>
                        </div>
                        <!-- /.box-body -->
                    </div>
                    <!-- /.box -->
                </div>
                <!-- /.col -->
            </div>
        </section>
        <!-- /.content -->
    </div>
    <!-- /.content-wrapper -->
    <!-- 在这里 写js函数-->
    <script type="text/javascript">
        var status = $(".status").html() == '1' ? "有效":"无效了";
        $(".status").html(status);

        var sex = $(".sex").html();
        if(sex == '2'){
            $(".sex").html('女');
        }else if(sex == '1'){
            $(".sex").html('男');
        }else{
            $(".sex").html('保密');
        }
    </script>
@endsection


